package com.yang.proxy.dynamicproxy.cglib;

import com.yang.proxy.ActualBuyer;
import com.yang.proxy.Buyer;
import net.sf.cglib.core.DebuggingClassWriter;
import net.sf.cglib.proxy.Enhancer;

/**
 * @author yang
 * @version 0.1
 * @date 2019/4/12
 */
public class CglibProxyTest {

    public static void main(String[] args) {
        System.setProperty(DebuggingClassWriter.DEBUG_LOCATION_PROPERTY, "F:\\");
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(ActualBuyer.class);
        enhancer.setCallback(new CglibProxy());
        Buyer buyer = (Buyer) enhancer.create();
        buyer.house();
    }
}
